home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Misc. Utilities / Installer / Installer 3.2 / Samples - Installer 3.2 / SimpleEasyOnly.r < prev    next >
Encoding:
Text File  |  1992-01-22  |  4.6 KB  |  123 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: very simple installation (Easy Installation only)
  6.  *
  7.  *    File:        SimpleEasyOnly.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *
  11.  *    Copyright © 1991 Apple Computer, Inc.
  12.  *    All rights reserved.
  13.  *
  14.  *------------------------------------------------------------------------------
  15.  *
  16.  * Install application "TheProgram" into the folder "Root":Installed Application
  17.  * It demonstrates only Easy Installation (Custom Installation is not supported)
  18.  *----------------------------------------------------------------------------*/
  19.  
  20. #include "InstallerTypes.r"
  21.  
  22. /* You can build and complete the script with the following lines:
  23. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  24. # or set up folders with the same names and contents as the floppies
  25. # put these folders in the same folder as the script or at the root directory of same disk
  26.  
  27.     rez -o "SimpleEasyOnly" -t 'bjbc' -c 'bjbc' "SimpleEasyOnly.r"
  28.     setfile -a i "SimpleEasyOnly"        #mark Inited
  29.     scriptcheck -p "SimpleEasyOnly"
  30. */
  31.  
  32. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  33. #define kScriptCheckSetsDate    0x01
  34.  
  35. /* Definitions for the rule */
  36. #define rlDoInstall                1000
  37.  
  38. /* Definitions for the file spec atoms (specifications for source and destination files) */
  39. #define fsSourceProgram            2000
  40. #define fsTargetProgram            2001
  41.  
  42. /* This is the name of the source disk */
  43. #define ProgramDisk "Program Disk:"
  44.  
  45. /* This is the target path for where we want to install the file. */
  46. #define TargetPath    ":Installed Application:"
  47.  
  48. /* Definition for the package. */
  49. #define pkTheProgram            3000
  50.  
  51. /* Definition for the file atom */
  52. #define faProgram                4000
  53.  
  54. /************************** Rule resources for Easy Install **********************************/
  55.  
  56. /* need 1 and only 1 framework to tell the installer how to process the rule(s) */
  57. resource 'infr' (1) {
  58.     format0  {{
  59.         pickAll,    {rlDoInstall},    /* Process "all" of the rules */
  60.     }};
  61. };
  62.  
  63. resource 'inrl' (rlDoInstall) {
  64.     format0 {{
  65.         addUserDescription {"The Program\n"},        /* message to appear in Easy Install screen */
  66.         addPackages {{pkTheProgram}}                /* we're only installing the program */
  67.     }};
  68. };
  69. /***************************** Package Resources ************************************************/
  70. resource 'inpk' (pkTheProgram) {
  71.     format0 {
  72.         doesntShowOnCustom,         /* Package doesn't appear in the Custom Install display */
  73.         removable,                    /* Package can be removed */
  74.         dontForceRestart,            /* no need to reboot after live install */
  75.         0,                             /* 'icmt' not used in a package that does not show on custom */
  76.         0,                            /* Package size (filled in by ScriptCheck) */
  77.         "", {                        /* package name not used in a package that does not show on custom    */
  78.             'infa', faProgram;
  79.         }
  80.     }
  81. };
  82.  
  83. /********************************************* File Specs ***********************************************/
  84. /* Source File Specs */
  85. resource 'infs' (fsSourceProgram) {
  86.     'APPL',                                /* File Type */
  87.     'Arfz',                                /* Creator */
  88.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  89.     noSearchForFile,                    /* Do not search the source disk for the file */
  90.     typeCrMustMatch,                    /* file type and creator on this file must match */
  91.     ProgramDisk"TheProgram"                /* Path to the file */
  92. };
  93.  
  94. /* Target File Specs */
  95. resource 'infs' (fsTargetProgram) {
  96.     'APPL',                                /* File Type */
  97.     'Arfz',                                /* Creator */
  98.     0,                                    /* not needed for target file spec */
  99.     noSearchForFile,                    /* Do not search the target disk for the file */
  100.     typeCrMustMatch,                    /* not needed for target file specs */
  101.     TargetPath"TheProgram"                /* installation Path */
  102. };
  103.  
  104. /******************************************** File Atoms ************************************************/
  105. resource 'infa' (faProgram) {
  106.     format0 {
  107.         deleteWhenRemoving,                /* Delete the file if remove is clicked(option-custom) */
  108.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  109.         copy,                             /* Copy the file to the destination */
  110.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  111.         updateExisting,                 /* replace an existing copy, if mine is newer */
  112.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  113.         rsrcFork, dataFork,                /* Copy both forks of the file */
  114.         fsTargetProgram,                /* TARGET file spec */
  115.         fsSourceProgram,                 /* SOURCE file spec */
  116.         0,                                /* atom size (filled in by ScriptCheck) */
  117.         ""                                /* Atom Description (for a file Installer will use file name) */
  118.     };
  119. };
  120.  
  121.  
  122.  
  123.